#ifndef __Measurement_h
#define __Measurement_h


#define CONFIG_INTERNAL_XENON_CONV_CONTROL 1
#ifdef CONFIG_INTERNAL_XENON_CONV_CONTROL
#define DDC114_Start_Conversion() \
  { \
    DrvPWM_Enable(DRVPWM_TIMER0, 1); \
  }

#define DDC114_Stop_Conversion() \
  {	\
    DrvPWM_Enable(DRVPWM_TIMER0, 0); \
  }
  //while(DrvPWM_GetTimerCounter(DRVPWM_TIMER0)); \

//#define Led_On()  DrvGPIO_SetBit(GPA, 15);
//#define Led_Off()  DrvGPIO_ClrBit(GPA, 15);
#define Led_On(a) Led_Current_Sink_On(a);
#define	Led_Off() Led_Current_Sink_Off();

#else
#define DDC114_Start_Conversion() DrvGPIO_SetBit(GPB, 10)
#define DDC114_Stop_Conversion() DrvGPIO_ClrBit(GPB, 10);
#define Led_On() DrvGPIO_SetBit(GPB, 11)
#define Led_Off() DrvGPIO_ClrBit(GPB, 11);
#endif  //CONFIG_INTERNAL_XENON_CONV_CONTROL

#define MaestroNano_OD_Allow_Negative 1
#define Measure_times 100
#define Max_Evaluate_Iteration 20
#define Measure_phases 2
#define throw_samples 20

extern volatile uint32_t adc_data_ready, redundancy_entry;
extern double Start_Dvalid_CNR1, Stop_Dvalid_CNR1, Start_Dvalid_CNR2, Stop_Dvalid_CNR2;
extern int cur_phase, zero_count, adc_temp;
extern volatile int adc_data[Measure_phases][Measure_times];

//#define Measure_test_mode 1
#endif  //_Measurement_h

